package com.yc.sole.system.request;

import com.yc.sole.framework.validate.SaveGroup;
import com.yc.sole.framework.validate.UpdateGroup;
import jakarta.validation.constraints.Min;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Pattern;
import lombok.Data;
import org.hibernate.validator.constraints.Length;

import java.io.Serializable;

/**
 * Request对象
 *
 * @author yizuomin
 * @date 2024-01-23
 **/
@Data
public class ConfigReq implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     *
     */
    @NotNull(groups = {UpdateGroup.class})
    private Long id;
    /**
     * 企业名称
     */
    @Length(max = 50, groups = {SaveGroup.class, UpdateGroup.class})
    @NotBlank(groups = {SaveGroup.class, UpdateGroup.class})
    private String enterpriseName;
    /**
     * 默认密码
     */
    @Length(max = 18, groups = {SaveGroup.class, UpdateGroup.class})
    @NotBlank(groups = {SaveGroup.class, UpdateGroup.class})
    private String defaultPassword;
    /**
     * 税率
     */
    @Min(value = 3, groups = {SaveGroup.class, UpdateGroup.class})
    @NotNull(groups = {SaveGroup.class, UpdateGroup.class})
    private Integer taxRate;
    /**
     * 二维码路径
     */
    @Length(max = 255, groups = {SaveGroup.class, UpdateGroup.class})
    @NotBlank(groups = {SaveGroup.class, UpdateGroup.class})
    private String qrCodeUrl;
    /**
     * 企业全名
     */
    @Length(max = 100, groups = {SaveGroup.class, UpdateGroup.class})
    @NotBlank(groups = {SaveGroup.class, UpdateGroup.class})
    private String enterpriseFullName;
    /**
     * 电话号码
     */
    @Length(max = 20, groups = {SaveGroup.class, UpdateGroup.class})
    @NotBlank(groups = {SaveGroup.class, UpdateGroup.class})
    private String landlineNum;
    /**
     * 传真号码
     */
    @Length(max = 20, groups = {SaveGroup.class, UpdateGroup.class})
    @NotBlank(groups = {SaveGroup.class, UpdateGroup.class})
    private String faxNum;
    /**
     * 手机号码
     */
    @Length(max = 20, groups = {SaveGroup.class, UpdateGroup.class})
    @NotBlank(groups = {SaveGroup.class, UpdateGroup.class})
    @Pattern(regexp = "^1[3-9]\\d{9}$", message = "手机号格式不正确", groups = {SaveGroup.class, UpdateGroup.class})
    private String phoneNum;
    /**
     * 地址
     */
    @Length(max = 255, groups = {SaveGroup.class, UpdateGroup.class})
    @NotBlank(groups = {SaveGroup.class, UpdateGroup.class})
    private String address;
}
